#include "stdafx.h"
#include "AKCommon.h"

#include "UnitTest++.h"
#include "CDSQStateMaintainer.h"

namespace {

struct CDSQFixture
{
	CDSQFixture() :_numOfSides(2){};

	//AKSideIndex _side;
	unsigned int _numOfSides;
};

TEST_FIXTURE(CDSQFixture, DSQTest)
{
	const vector<AKPiece>* _vpiece;
	//Check sample for getPlaceablePiecesAtCell
	CDSQStateMaintainer maintainer(_numOfSides);
	maintainer.backToInitialState();

	_vpiece = maintainer.getPlaceablePiecesAtCell(1);
	CHECK(_vpiece != NULL);
	CHECK_EQUAL(3, _vpiece->size());

	//Check sample for getReachableCellsForPiece
	const vector<AKCellIndex>* _vcellIndex;
	AKPiece _piece;
	_piece.cell = 2;
	_piece.piece = 8;
	_piece.side = Left;
	_vcellIndex = maintainer.getReachableCellsForPiece(_piece);

	CHECK_EQUAL(3, _vcellIndex->size());
	CHECK_EQUAL(1, (*_vcellIndex)[0]);
}

} // namespace